package com.example.ordersystem.domain;


import java.io.Serializable;

public class Lineitem implements Serializable {

    /**订单编号*/

    private String orderNum;

    /**订单项编号*/

    private int num;

    /**菜品编号*/

    private int dishNum;

    /**菜品单价*/

    private int dishPrice;

    /**订购数量*/

    private int quantity;

    /**订单项金额*/
    private int amount;


    public Lineitem() {
        super();
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getDishNum() {
        return dishNum;
    }

    public void setDishNum(int dishNum) {
        this.dishNum = dishNum;
    }

    public int getDishPrice() {
        return dishPrice;
    }

    public void setDishPrice(int dishPrice) {
        this.dishPrice = dishPrice;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public Lineitem(String orderNum, int num, int dishNum, int dishPrice, int quantity) {
        super();
        this.orderNum = orderNum;
        this.num = num;
        this.dishNum = dishNum;
        this.dishPrice = dishPrice;
        this.quantity = quantity;

        /*菜品单价*订购数量*/
        this.amount = dishPrice * quantity;
    }


    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Lineitem) {
            Lineitem lobj = (Lineitem)obj;
            return this.getNum() == lobj.getNum();
        }
        return false;
    }
}
